import { GTextFormat } from "../../../../common/GTextFormat";
import { ObjCreate } from "../ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
//class SeparateTooltip
    
    export  class SeparateTooltip /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            return;
        }

        public set data(arg1: Array<any>)
        {
            var loc1=null;
            var loc2=null;
            var loc3=null;
            var loc4=0;
            var loc5=0;
            var loc7=null;
            this.dispose();
            var loc6=0;
            while (loc6 < arg1.length) 
            {
                if (typeof arg1[loc6] === "string") 
                {
                    loc1 = new Object /* flash.text.TextField */();
                    loc1.defaultTextFormat = new GTextFormat("", null, null, null, null, null, null, null, null, null, null, null, 3);
                    loc1.autoSize = flash.text.TextFieldAutoSize.LEFT;
                    loc1.multiline = true;
                    loc1.htmlText = "<font color=\'#b1efff\'>" + arg1[loc6] + "</font>";
                    loc1.y = loc4;
                    addChild(loc1);
                    if (loc1.width < 120) 
                    {
                        loc5 = loc1.width + 10;
                    }
                    else 
                    {
                        loc5 = 180;
                    }
                    if (loc6 < (arg1.length - 1)) 
                    {
                        loc3 = ObjCreate.createBg(5, loc4 + loc1.textHeight, loc5, 1, this, ImagesConst.SeptalLine);
                    }
                    loc4 = loc4 + loc1.textHeight + 10;
                }
                else if (arg1[loc6] is flash.display.BitmapData) 
                {
                    loc2 = new Object /* flash.display.Bitmap */();
                    loc2.y = loc4;
                    loc2.bitmapData = arg1[loc6];
                    addChild(loc2);
                    loc4 = loc4 + loc2.height + 10;
                }
                ++loc6;
            }
            var loc8=0;
            while (loc8 < this.numChildren) 
            {
                if ((loc7 = getChildAt(loc8)) is flash.display.Bitmap) 
                {
                    if (this.width > loc7.width) 
                    {
                        loc7.x = (this.width - loc7.width) / 2;
                    }
                }
                ++loc8;
            }
            return;
        }

        public dispose(): void
        {
            while (this.numChildren) 
            {
                removeChildAt(0);
            }
            return;
        }
    }
